package com.java.permission.common.utils;

import org.apache.commons.lang3.StringUtils;

/**
 * @author hu
 * @version 1.0
 * @date 2020/6/12 10:00
 * @description 父节点 id集合
 */
public class SysOfficeParentIdsUtils {
    public final static String SEPARATOR = ",";

    public final static String ROOT = "0";
    /**
     * 计算父节点集合
     * @param parentLevel
     * @param parentId
     * @return
     */
    public static String calculateParentIds(String parentLevel, String parentId) {
        if (StringUtils.isBlank(parentLevel)) {
            return ROOT;
        } else {
            return StringUtils.join(parentLevel, SEPARATOR, parentId);
        }
    }
}
